#!/bin/sh
# /**
# * Copyright (c) 2018, God's harbor
# * All rights reserved.
# * @file    backup_vimcfg.sh
# * @brief   将vim相关的配置被分到特定的目录：~/vimcfg
# * @author  Jason Zhou,yzfcer@163.com
# * @version 1.0
# * @date    2021-09-15
# */



function main()
{
    echo "copy backup files"
    dtime=$(date "+%Y%m%d%H%M%S")
    echo $dtime
    destdir=vimcfg-${dtime}
    mkdir -p ~/vimcfg
    mkdir -p ~/vimcfg/${destdir}
    cp -rf ~/.vimrc ~/vimcfg/${destdir}
    cp -rf ~/.vim ~/vimcfg/${destdir}
    cd ~/vimcfg
    tar zcvf ${destdir}.tar.gz ${destdir}
    rm -rf ${destdir}
    echo "******* target:~/vimcfg/${destdir}.tar.gz"
}
main $@
